/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.sample.library.model;

import com.sample.library.service.persistence.AuthorBookPK;

import java.io.Serializable;

import java.util.ArrayList;
import java.util.List;

/**
 * This class is used by SOAP remote services, specifically {@link com.sample.library.service.http.AuthorBookServiceSoap}.
 *
 * @author    Nguyen Tuan Anh
 * @see       com.sample.library.service.http.AuthorBookServiceSoap
 * @generated
 */
public class AuthorBookSoap implements Serializable {
	public static AuthorBookSoap toSoapModel(AuthorBook model) {
		AuthorBookSoap soapModel = new AuthorBookSoap();

		soapModel.setBookId(model.getBookId());
		soapModel.setAuthorId(model.getAuthorId());

		return soapModel;
	}

	public static AuthorBookSoap[] toSoapModels(AuthorBook[] models) {
		AuthorBookSoap[] soapModels = new AuthorBookSoap[models.length];

		for (int i = 0; i < models.length; i++) {
			soapModels[i] = toSoapModel(models[i]);
		}

		return soapModels;
	}

	public static AuthorBookSoap[][] toSoapModels(AuthorBook[][] models) {
		AuthorBookSoap[][] soapModels = null;

		if (models.length > 0) {
			soapModels = new AuthorBookSoap[models.length][models[0].length];
		}
		else {
			soapModels = new AuthorBookSoap[0][0];
		}

		for (int i = 0; i < models.length; i++) {
			soapModels[i] = toSoapModels(models[i]);
		}

		return soapModels;
	}

	public static AuthorBookSoap[] toSoapModels(List<AuthorBook> models) {
		List<AuthorBookSoap> soapModels = new ArrayList<AuthorBookSoap>(models.size());

		for (AuthorBook model : models) {
			soapModels.add(toSoapModel(model));
		}

		return soapModels.toArray(new AuthorBookSoap[soapModels.size()]);
	}

	public AuthorBookSoap() {
	}

	public AuthorBookPK getPrimaryKey() {
		return new AuthorBookPK(_bookId, _authorId);
	}

	public void setPrimaryKey(AuthorBookPK pk) {
		setBookId(pk.bookId);
		setAuthorId(pk.authorId);
	}

	public long getBookId() {
		return _bookId;
	}

	public void setBookId(long bookId) {
		_bookId = bookId;
	}

	public String getAuthorId() {
		return _authorId;
	}

	public void setAuthorId(String authorId) {
		_authorId = authorId;
	}

	private long _bookId;
	private String _authorId;
}